#include "libav.hpp"
#include <nodelet/nodelet.h>
#include <pluginlib/class_list_macros.h>

namespace libav_nodelet {
class LibAVNodelet : public nodelet::Nodelet {
 public:
  LibAVNodelet(){};
  ~LibAVNodelet(){};

  virtual void onInit() {
    ros::NodeHandle nh = this->getPrivateNodeHandle();
    NODELET_INFO_STREAM("Init nodelet... ["<<nh.getUnresolvedNamespace()<<"]");
    std::string addr;
    addr = nh.param<std::string>("addr", "rtps://127.0.0.1");
    libav_.reset(new LibAV(&nh));
    libav_->init(addr);
  }
  private:
    boost::shared_ptr<LibAV> libav_;
};
}

PLUGINLIB_EXPORT_CLASS(libav_nodelet::LibAVNodelet, nodelet::Nodelet);
